using IM.Easy.Infrastructure.Query;
using System.ComponentModel.DataAnnotations;


namespace IM.Easy.SystemServices.Dtos
{
    /// <summary>
    /// 请求追踪表查询实体
    /// </summary>
    public class RequestTrackingLogQueryDto : QueryBase
    {
        public string UserName { get; set; }

        public DateTime? BeginRequestTime { get; set; }

        public DateTime? EndRequestTime { get; set; }

    }

    /// <summary>
    /// 请求追踪表dto
    /// </summary>
    public class RequestTrackingLogDto
    {
        /// <summary>
        /// 主键，唯一ID
        /// </summary>
        public string Id { get; set; }
        /// <summary>
        /// 请求的唯一追踪ID，用于标识整个请求链路
        /// </summary>
        public string TraceIdentifier { get; set; }
        /// <summary>
        /// 请求时间
        /// </summary>
        public DateTime RequestTime { get; set; }
        /// <summary>
        /// 响应时间
        /// </summary>
        public DateTime ResponseTime { get; set; }
        /// <summary>
        /// 请求持续时间（毫秒）
        /// </summary>
        public long Duration { get; set; }
        /// <summary>
        /// HTTP请求方法（如GET、POST等）
        /// </summary>
        public string HttpMethod { get; set; }
        /// <summary>
        /// 请求的完整URL
        /// </summary>
        public string Url { get; set; }
        /// <summary>
        /// 请求参数
        /// </summary>
        public string Arguments { get; set; }
        /// <summary>
        /// 响应体内容（视需求可截断或记录摘要）
        /// </summary>
        public string ResponseBody { get; set; }
        /// <summary>
        /// 客户端物理地址
        /// </summary>
        public string Address { get; set; }
        /// <summary>
        /// 客户端IP地址
        /// </summary>
        public string ClientIP { get; set; }
        /// <summary>
        /// 操作人
        /// </summary>
        public string UserName { get; set; }
        /// <summary>
        /// 用户ID（如果请求有认证信息）
        /// </summary>
        public long UserId { get; set; }
        /// <summary>
        /// 用户代理信息（如浏览器类型、版本等）
        /// </summary>
        public string UserAgent { get; set; }
        /// <summary>
        /// 记录创建时间
        /// </summary>
        public DateTime CreatedAt { get; set; }
        /// <summary>
        /// 关联接口id
        /// </summary>
        public long EndpointId { get; set; }
        /// <summary>
        /// 接口名称
        /// </summary>
        public string ActionName { get; set; }
    }

    /// <summary>
    /// 操作统计实体
    /// </summary>
    public class OperationChartData()
    {
        /// <summary>
        /// 日期
        /// </summary>
        public string Date { get; set; }

        /// <summary>
        /// 频次
        /// </summary>
        public int Frequency { get; set; }

        /// <summary>
        /// 访客数
        /// </summary>
        public int Visitor { get; set; }
    }

}
